
/**
 * 
 * @param {*} content 需要传递的内容
 */
export const showToast = (content) => {
  return new Promise((resolve,reject) => {
    wx.showToast({
      title: content,
      icon: 'none',
      mask:true,
      success: res => resolve(res),
      fail: err => reject(err)
    })
  })
}
/**
 * 
 * @param {*} content 
 */
export const wxLogin = () => {
  return new Promise((resolve,reject) => {
    wx.login({
      timeout: 5000,
      success: res => {
        resolve(res);
      },
      fail:err => {
        reject(err)
      }
    })
  })
}

/**
 * 
 * 微信支付
 */
export const requestPayment = payParams => {
  return new Promise((resolve,reject) => {
    wx.requestPayment({
      ...payParams,
      success: result => {
        resolve(result)
      },
      fail: err => {
        reject(err);
      }
    })
  })
}





